home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / PrintUsingPost.pprx < prev    next >
Text File  |  1993-05-25  |  2KB  |  56 lines

  1. /* This genie uses the public domain Postscript interpreter "Post" to print your document. The advantages are that you can print .eps files on a non-Postscript printer and that you can use real Type 1 fonts, rather than converted versions.  The files "post" and "init.ps" should be in a drawer called "post" in your "PPage:" drawer (if not, modify the indicated line in the genie), the necessary .psfont files in CGFonts:ps, and "post.library" in libs:  You do NOT need "Conman". 
  2. Make sure the assigns for PPage: and CGFonts: are set up in your startup-sequence or user-startup files. It is also essential to set the Limits in your printer graphics preferences to the correct page size in pixels i.e. the printer's dots-per-inch * page size in inches. Typical figures are 1500 by 2100. */
  3. /* Note: There is a bug in Post which means that it will refuse to print colour bitmaps on colour printers under WB 2.04. It seems to be OK under WB 1.3. 
  4. Also, gradient fills do not work in colour. Colour separations and B&W are OK. 
  5. Versions of Post older than 1.7 have problems with files from Quark XPress and Freehand.
  6. */
  7. /* Written by Don Cox. Copyright. Not Public Domain. All rights reserved. */
  8.  
  9.  
  10. trace n
  11. signal on error
  12. signal on syntax
  13. address command
  14. call SafeEndEdit.rexx()
  15. call ppm_AutoUpdate(0)
  16. cr="0a"x
  17.  
  18. oldoutput = ppm_GetPSOutput()
  19. call ppm_SetPSFontDownload(0)
  20. call ppm_SetPSOutput("PPage:temp.ps")
  21. success = ppm_PrintDocPS(1,1)
  22. if success ~=1 then exit_msg("Failed saving temporary Postscript file.")
  23.  
  24. /* Set up a text file in ram: and then send it to a temporary command window */
  25. conwindow = "CON:40/40/500/200/NewWindow"
  26. call open out, "ram:temp", write  /* This wipes out any existing ram:temp  */
  27. call writeln out, "cd PPage:Post" /* post is in drawer "Post" in "PPage:" - if not, change this line  */
  28. call writeln out, "post init.ps PPage:temp.ps" /* To use lots of fonts in one document, add memory to Post here. See Post documentation. */
  29. call writeln out, "delete PPage:temp.ps"
  30. call writeln out, "endcli"
  31. call close out
  32. "newcli" conwindow "ram:temp"
  33.  
  34. call ppm_SetPSOutput(oldoutput)
  35. call exit_msg()
  36.  
  37. end
  38.  
  39. error:
  40. syntax:
  41.     do
  42.     exit_msg("Genie failed due to error: "errortext(rc))
  43.     end
  44.  
  45. exit_msg:
  46.     do
  47.     parse arg message
  48.     if message ~= "" then
  49.     call ppm_Inform(1,message)
  50.     call ppm_ClearStatus()
  51.     call ppm_PPageToFront()
  52.     call ppm_AutoUpdate(1)
  53.     exit
  54.     end
  55.  
  56.